





<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Relay 基础张量算子 &mdash; tvm 0.8.dev1982 文档</title>
  

  
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/gallery.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/tlcpack_theme.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/tvm-logo-square.png"/>
  

  
  
  
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/translations.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <script type="text/javascript" src="../../_static/js/tlcpack_theme.js"></script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="Pattern Matching in Relay" href="relay_pattern.html" />
    <link rel="prev" title="Algebraic Data Types in Relay" href="relay_adt.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    
<header class="header">
    <div class="innercontainer">
      <div class="headerInner d-flex justify-content-between align-items-center">
          <div class="headerLogo">
               <a href="https://tvm.apache.org/"><img src=https://tvm.apache.org/assets/images/logo.svg alt="logo"></a>
          </div>

          <div id="headMenu" class="headerNav">
            <button type="button" id="closeHeadMenu" class="navCloseBtn"><img src="../../_static/img/close-icon.svg" alt="Close"></button>
             <ul class="nav">
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/community>Community</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/download>Download</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/vta>VTA</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/blog>Blog</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/docs>Docs</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmconf.org>Conference</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://github.com/apache/tvm/>Github</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmchinese.github.io/declaration_zh_CN.html>About-Translators</a>
                </li>
             </ul>
               <div class="responsivetlcdropdown">
                 <button type="button" class="btn-link">
                   ASF
                 </button>
                 <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                 </ul>
               </div>
          </div>
            <div class="responsiveMenuIcon">
              <button type="button" id="menuBtn" class="btn-menu"><img src="../../_static/img/menu-icon.svg" alt="Menu Icon"></button>
            </div>

            <div class="tlcDropdown">
              <div class="dropdown">
                <button type="button" class="btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  ASF
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                  <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                  </ul>
                </div>
              </div>
          </div>
       </div>
    </div>
 </header>
 
    <nav data-toggle="wy-nav-shift" class="wy-nav-side fixed">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html">
          

          
            
            <img src="../../_static/tvm-logo-small.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
                <div class="version">
                  0.8.dev1982
                </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">如何开始</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../install/index.html">安装 TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contribute/index.html">贡献者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">用户引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/index.html">User Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../how_to/index.html">How To Guides</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">开发者引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../dev/tutorial/index.html">Developer Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/how_to/how_to.html">开发者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">架构指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">Design and Architecture</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">主题引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../topic/microtvm/index.html">microTVM：裸机使用TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../topic/vta/index.html">VTA: Versatile Tensor Accelerator</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">参考指南</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">语言参考</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="index.html#introduction-to-relay">Relay简介</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="relay_expr.html">Expressions in Relay</a></li>
<li class="toctree-l3"><a class="reference internal" href="relay_type.html">Relay 系统类型</a></li>
<li class="toctree-l3"><a class="reference internal" href="relay_adt.html">Algebraic Data Types in Relay</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Relay 基础张量算子</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#overview-of-operators">算子概述</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="relay_pattern.html">Pattern Matching in Relay</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="index.html#hybrid-script">混合式脚本</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../api/python/index.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/links.html">Other APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../publications.html">Publications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../genindex.html">索引</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
      
      <nav class="wy-nav-top" aria-label="top navigation" data-toggle="wy-nav-top">
        
            <div class="togglemenu">

            </div>
            <div class="nav-content">
              <!-- tvm -->
              Table of content
            </div>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        

          




















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html">Docs</a> <span class="br-arrow">></span></li>
        
          <li><a href="index.html">语言参考</a> <span class="br-arrow">></span></li>
        
      <li>Relay 基础张量算子</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../_sources/reference/langref/relay_op.rst.txt" rel="nofollow"> <img src="../../_static//img/source.svg" alt="viewsource"/></a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="relay-core-tensor-operators">
<h1>Relay 基础张量算子<a class="headerlink" href="#relay-core-tensor-operators" title="永久链接至标题">¶</a></h1>
<p>此页面包含 tvm.realy 中预先定义的核心张量算子原始数列表。核心张量算子原语涵盖深度学习中的典型工作量。它们可以代表前端框架中的工作内容，并为优化提供基本构建基块。由于深度学习是一个快速发展的领域，因此有可能有些算子不在这里。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>本文档将直接列出这些算子在 python 前端中的函数签名。</p>
</div>
<div class="section" id="overview-of-operators">
<h2>算子概述<a class="headerlink" href="#overview-of-operators" title="永久链接至标题">¶</a></h2>
<p><strong>级别 1：基础算子</strong></p>
<p>此级别可实现多层的全连接感知器。</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.log</span></code></p></td>
<td><p>数据的点对应对数运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sqrt</span></code></p></td>
<td><p>数据的点对应平方根运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.rsqrt</span></code></p></td>
<td><p>数据的点对应平方根倒数运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.exp</span></code></p></td>
<td><p>数据的点对应以 e 为底的指数运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sigmoid</span></code></p></td>
<td><p>数据的点对应 sigmoid 运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.add</span></code></p></td>
<td><p>Numpy 风格的广播加法运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.subtract</span></code></p></td>
<td><p>Numpy 风格的广播减法运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.multiply</span></code></p></td>
<td><p>Numpy 风格的广播乘法运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.divide</span></code></p></td>
<td><p>Numpy 风格的广播除法运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.mod</span></code></p></td>
<td><p>Numpy 风格的广播取模运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.tanh</span></code></p></td>
<td><p>数据的点对应 tanh 运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.concatenate</span></code></p></td>
<td><p>根据给定的轴连接输入张量。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.expand_dims</span></code></p></td>
<td><p>在 <cite>axis</cite> 给定的位置插入 <cite>num_newaxis</cite> 坐标轴。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.softmax" title="tvm.relay.nn.softmax"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.softmax</span></code></a></p></td>
<td><p>计算 softmax。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.log_softmax" title="tvm.relay.nn.log_softmax"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.log_softmax</span></code></a></p></td>
<td><p>计算 log_softmax。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.relu" title="tvm.relay.nn.relu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.relu</span></code></a></p></td>
<td><p>修正线性单元。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.dropout" title="tvm.relay.nn.dropout"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.dropout</span></code></a></p></td>
<td><p>对输入数列使用 dropout 算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.batch_norm" title="tvm.relay.nn.batch_norm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.batch_norm</span></code></a></p></td>
<td><p>批量处理规范化层 （Ioffe and Szegedy, 2014）。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.bias_add" title="tvm.relay.nn.bias_add"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.bias_add</span></code></a></p></td>
<td><p>add_bias 算子。</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 2： 卷积</strong></p>
<p>此级别使用在典型的卷积模型。</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.conv2d" title="tvm.relay.nn.conv2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.conv2d</span></code></a></p></td>
<td><p>2D 卷积。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.conv2d_transpose" title="tvm.relay.nn.conv2d_transpose"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.conv2d_transpose</span></code></a></p></td>
<td><p>二维转置卷积算子。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.conv3d" title="tvm.relay.nn.conv3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.conv3d</span></code></a></p></td>
<td><p>3D 卷积。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.conv3d_transpose" title="tvm.relay.nn.conv3d_transpose"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.conv3d_transpose</span></code></a></p></td>
<td><p>3D 转置卷积。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.dense" title="tvm.relay.nn.dense"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.dense</span></code></a></p></td>
<td><p>稠密算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.max_pool2d" title="tvm.relay.nn.max_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.max_pool2d</span></code></a></p></td>
<td><p>2D 最大池化算子。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.max_pool3d" title="tvm.relay.nn.max_pool3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.max_pool3d</span></code></a></p></td>
<td><p>3D 最大池化算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.avg_pool2d" title="tvm.relay.nn.avg_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.avg_pool2d</span></code></a></p></td>
<td><p>2D 平均池化算子。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.avg_pool3d" title="tvm.relay.nn.avg_pool3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.avg_pool3d</span></code></a></p></td>
<td><p>3D 平均池化算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.global_max_pool2d" title="tvm.relay.nn.global_max_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.global_max_pool2d</span></code></a></p></td>
<td><p>2D 全局最大池化算子。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.global_avg_pool2d" title="tvm.relay.nn.global_avg_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.global_avg_pool2d</span></code></a></p></td>
<td><p>2D 全局平均池化算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.upsampling" title="tvm.relay.nn.upsampling"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.upsampling</span></code></a></p></td>
<td><p>上采样。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.upsampling3d" title="tvm.relay.nn.upsampling3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.upsampling3d</span></code></a></p></td>
<td><p>3D 上采样。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.batch_flatten" title="tvm.relay.nn.batch_flatten"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.batch_flatten</span></code></a></p></td>
<td><p>BatchFlatten.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.pad" title="tvm.relay.nn.pad"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.pad</span></code></a></p></td>
<td><p>填充</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.lrn" title="tvm.relay.nn.lrn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.lrn</span></code></a></p></td>
<td><p>该算子将数据作为输入，并进行局部响应归一化。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.l2_normalize" title="tvm.relay.nn.l2_normalize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.l2_normalize</span></code></a></p></td>
<td><p>对输入数据执行L2标准化</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.bitpack" title="tvm.relay.nn.bitpack"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.bitpack</span></code></a></p></td>
<td><p>对于位序列算子的张量包装。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.bitserial_dense" title="tvm.relay.nn.bitserial_dense"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.bitserial_dense</span></code></a></p></td>
<td><p>位序列稠密算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.bitserial_conv2d" title="tvm.relay.nn.bitserial_conv2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.bitserial_conv2d</span></code></a></p></td>
<td><p>使用位序列计算的 2D 卷积。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.contrib_conv2d_winograd_without_weight_transform" title="tvm.relay.nn.contrib_conv2d_winograd_without_weight_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.contrib_conv2d_winograd_without_weight_transform</span></code></a></p></td>
<td><p>基于 Winograd 算法的 2D 卷积。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.contrib_conv2d_winograd_weight_transform" title="tvm.relay.nn.contrib_conv2d_winograd_weight_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.contrib_conv2d_winograd_weight_transform</span></code></a></p></td>
<td><p>基于 Winograd 算法对 2D 卷积的转换部分进行加权。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.contrib_conv3d_winograd_without_weight_transform" title="tvm.relay.nn.contrib_conv3d_winograd_without_weight_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.contrib_conv3d_winograd_without_weight_transform</span></code></a></p></td>
<td><p>基于 Winograd 算法的 3D 卷积。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.contrib_conv3d_winograd_weight_transform" title="tvm.relay.nn.contrib_conv3d_winograd_weight_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.contrib_conv3d_winograd_weight_transform</span></code></a></p></td>
<td><p>基于 Winograd 算法对 3D 卷积的转换部分进行加权。</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 3：附加数学函数和Transform 算子</strong></p>
<p>此级别是额外的数学函数和transform 算子。</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.leaky_relu" title="tvm.relay.nn.leaky_relu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.leaky_relu</span></code></a></p></td>
<td><p>该算子将数据作为输入，并代入带泄露的修正线性单元。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.prelu" title="tvm.relay.nn.prelu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.prelu</span></code></a></p></td>
<td><p>该算子将数据作为输入，并代入带泄露的修正线性单元。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reshape</span></code></p></td>
<td><p>重塑输入数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reshape_like</span></code></p></td>
<td><p>根据其他张量的形状，对输入张量进行重塑。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.copy</span></code></p></td>
<td><p>复制张量。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.transpose</span></code></p></td>
<td><p>对数组进行换维操作。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.squeeze</span></code></p></td>
<td><p>对数组进行维度压缩。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.floor</span></code></p></td>
<td><p>数据的点对应向下取整运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.ceil</span></code></p></td>
<td><p>数据的点对应向上取整运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sign</span></code></p></td>
<td><p>数据的点对应取绝对值运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.trunc</span></code></p></td>
<td><p>数据的点对应舍尾取整运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.clip</span></code></p></td>
<td><p>将 <cite>a</cite> 中的元素裁剪至 <cite>a_min</cite> 到 <cite>a_max</cite> 之间。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.round</span></code></p></td>
<td><p>数据的点对应四舍五入运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.abs</span></code></p></td>
<td><p>数据的点对应取绝对值运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.negative</span></code></p></td>
<td><p>数据的点对应取相反数运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.take</span></code></p></td>
<td><p>从数组的一条轴上取元素。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.zeros</span></code></p></td>
<td><p>用0填充数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.zeros_like</span></code></p></td>
<td><p>返回一个与输入数据相同数据类型与尺寸的全零数组。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.ones</span></code></p></td>
<td><p>用1填充数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.ones_like</span></code></p></td>
<td><p>返回一个与输入数据相同数据类型与尺寸的全一数组。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.gather</span></code></p></td>
<td><p>在给定的轴上对给定索引的值进行聚合。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.gather_nd</span></code></p></td>
<td><p>聚合数据的元素或切片，并将其储存到一个尺寸由索引定义的张量里。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.full</span></code></p></td>
<td><p>用标量填充数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.full_like</span></code></p></td>
<td><p>返回一个与输入数据相同数据类型与尺寸的标量数组。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.cast</span></code></p></td>
<td><p>转换输入向量的数据类型。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reinterpret</span></code></p></td>
<td><p>将输入张量重新解释为指定数据类型。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.split</span></code></p></td>
<td><p>沿轴按照一个元素或数组对输入张量进行切分。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.arange</span></code></p></td>
<td><p>在给定范围内返回均匀间隔的值。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.meshgrid</span></code></p></td>
<td><p>从坐标向量中创建坐标矩阵。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.stack</span></code></p></td>
<td><p>沿新轴连接一个数组序列。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.repeat</span></code></p></td>
<td><p>重复数组元素。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.tile</span></code></p></td>
<td><p>将整个数组重复若干次。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reverse</span></code></p></td>
<td><p>在保持数组形状不变的情况下，沿给定的轴反转元素顺序。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reverse_sequence</span></code></p></td>
<td><p>将张量内的每个可变长度切片进行翻转。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.unravel_index</span></code></p></td>
<td><p>将平面索引或平面索引数组转换为坐标数组的元组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sparse_to_dense</span></code></p></td>
<td><p>将稀疏张量表示转换为稠密张量。</p></td>
</tr>
</tbody>
</table>
<p><a href="#id1"><span class="problematic" id="id2">**</span></a>级别 4：广播和降维*</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.right_shift</span></code></p></td>
<td><p>Numpy 风格的广播向右移位运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.left_shift</span></code></p></td>
<td><p>Numpy 风格的广播向左移位运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.equal</span></code></p></td>
<td><p>对于(lhs == rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.not_equal</span></code></p></td>
<td><p>对于(lhs != rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.greater</span></code></p></td>
<td><p>对于(lhs &gt; rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.greater_equal</span></code></p></td>
<td><p>对于(lhs &gt;= rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.less</span></code></p></td>
<td><p>对于(lhs &lt; rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.less_equal</span></code></p></td>
<td><p>对于(lhs &lt;= rhs)，进行基于广播后的点对应判断。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.all</span></code></p></td>
<td><p>沿着给定的轴对布尔数组的元素执行逻辑与计算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.any</span></code></p></td>
<td><p>沿着给定的轴对布尔数组的元素执行逻辑或计算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.logical_and</span></code></p></td>
<td><p>Numpy 风格的广播逻辑与运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.logical_or</span></code></p></td>
<td><p>Numpy 风格的广播逻辑或运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.logical_not</span></code></p></td>
<td><p>数据的点对应逻辑否运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.logical_xor</span></code></p></td>
<td><p>Numpy 风格的广播逻辑异或运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.maximum</span></code></p></td>
<td><p>Numpy 风格的广播取最大值运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.minimum</span></code></p></td>
<td><p>Numpy 风格的广播取最小值运算。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.power</span></code></p></td>
<td><p>Numpy 风格的广播幂运算。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.where</span></code></p></td>
<td><p>根据 condition 的值来决定选择 x 或 y 的元素。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.argmax</span></code></p></td>
<td><p>沿轴返回最大值的索引。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.argmin</span></code></p></td>
<td><p>沿轴返回最小值的索引。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sum</span></code></p></td>
<td><p>计算给定轴上数组元素的和。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.max</span></code></p></td>
<td><p>计算给定轴上数组元素的最大值。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.min</span></code></p></td>
<td><p>计算给定轴上数组元素的最小值。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.mean</span></code></p></td>
<td><p>计算给定轴上数组元素的平均值。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.variance</span></code></p></td>
<td><p>计算给定轴上数组元素的方差。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.std</span></code></p></td>
<td><p>计算给定轴上数组元素的标准差。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.mean_variance</span></code></p></td>
<td><p>计算给定轴上数组元素的平均值与方差。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.mean_std</span></code></p></td>
<td><p>计算给定轴上数组元素的平均值与标准差。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.prod</span></code></p></td>
<td><p>计算给定轴上数组元素的乘积。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.strided_slice</span></code></p></td>
<td><p>提取数组的分段切片。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.broadcast_to</span></code></p></td>
<td><p>将标量数组广播至给定的形状并返回，且不改变其数据类型。</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 5：视觉/图像算子</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/image.html#tvm.relay.image.resize1d" title="tvm.relay.image.resize1d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.image.resize1d</span></code></a></p></td>
<td><p>图像 1 维重塑算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/image.html#tvm.relay.image.resize2d" title="tvm.relay.image.resize2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.image.resize2d</span></code></a></p></td>
<td><p>图像 2 维重塑算子。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/image.html#tvm.relay.image.resize3d" title="tvm.relay.image.resize3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.image.resize3d</span></code></a></p></td>
<td><p>图像 3 维重塑算子。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/image.html#tvm.relay.image.crop_and_resize" title="tvm.relay.image.crop_and_resize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.image.crop_and_resize</span></code></a></p></td>
<td><p>裁剪并调整输入图像的大小。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/image.html#tvm.relay.image.dilation2d" title="tvm.relay.image.dilation2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.image.dilation2d</span></code></a></p></td>
<td><p>2D 形态学膨胀。</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/vision.html#tvm.relay.vision.multibox_prior" title="tvm.relay.vision.multibox_prior"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.vision.multibox_prior</span></code></a></p></td>
<td><p>在 data 中，根据 sizes 和 ratios 生成先验框（锚框）。</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/vision.html#tvm.relay.vision.multibox_transform_loc" title="tvm.relay.vision.multibox_transform_loc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.vision.multibox_transform_loc</span></code></a></p></td>
<td><p>Location transformation for multibox detection</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.vision.nms</span></code></p></td>
<td><p>Non-maximum suppression operations.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/vision.html#tvm.relay.vision.yolo_reorg" title="tvm.relay.vision.yolo_reorg"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.vision.yolo_reorg</span></code></a></p></td>
<td><p>Yolo reorg operation used in darknet models.</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 6：算法算子</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.argsort</span></code></p></td>
<td><p>沿给定轴对数组执行排序操作后，保持数组形状不变，输出排序数组对应的索引数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.topk</span></code></p></td>
<td><p>沿给定的轴，获取输入张量的最大 k 个元素。</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 10： 临时算子</strong></p>
<p>此级别支持广播算子的反向传播。这是暂时的。</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.broadcast_to_like</span></code></p></td>
<td><p>返回一个与输入数据相同数据类型与尺寸的标量数组。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.collapse_sum_like</span></code></p></td>
<td><p>返回一个与输入数据相同数据类型与尺寸的标量数组。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.slice_like</span></code></p></td>
<td><p>按照第二个输出值的形状对第一个输出值进行切分。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.shape_of</span></code></p></td>
<td><p>获得张量的形状。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.ndarray_size</span></code></p></td>
<td><p>获得张量的元素数量。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.layout_transform</span></code></p></td>
<td><p>变换张量的布局。</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.device_copy</span></code></p></td>
<td><p>将数据从源设备复制到目标设备。</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.annotation.on_device</span></code></p></td>
<td><p>Annotates an expression with the device type on which its result should be stored.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.reverse_reshape</span></code></p></td>
<td><p>Reshapes the input array where the special values are inferred from right to left.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.sequence_mask</span></code></p></td>
<td><p>Sets all elements outside the expected length of the sequence to a constant value.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.batch_matmul" title="tvm.relay.nn.batch_matmul"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.batch_matmul</span></code></a></p></td>
<td><p>Compute batch matrix multiplication of <cite>tensor_a</cite> and <cite>tensor_b</cite>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.adaptive_max_pool2d" title="tvm.relay.nn.adaptive_max_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.adaptive_max_pool2d</span></code></a></p></td>
<td><p>2D adaptive max pooling operator.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api/python/relay/nn.html#tvm.relay.nn.adaptive_avg_pool2d" title="tvm.relay.nn.adaptive_avg_pool2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.nn.adaptive_avg_pool2d</span></code></a></p></td>
<td><p>2D adaptive average pooling operator.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.one_hot</span></code></p></td>
<td><p>Returns a one-hot tensor where the locations repsented by indices take value on_value, other locations take value off_value.</p></td>
</tr>
</tbody>
</table>
<p><strong>级别 11：Dialect 算子</strong></p>
<p>This level supports dialect operators.</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.qnn.op.requantize</span></code></p></td>
<td><p>Requantized operator.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">tvm.relay.qnn.op.conv2d</span></code></p></td>
<td><p>Quantized 2D convolution.</p></td>
</tr>
</tbody>
</table>
</div>
</div>


           </div>
           
          </div>
          

<footer>

    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="relay_pattern.html" class="btn btn-neutral float-right" title="Pattern Matching in Relay" accesskey="n" rel="next">下一个 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="relay_adt.html" class="btn btn-neutral float-left" title="Algebraic Data Types in Relay" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一个</a>
      
    </div>

<div id="button" class="backtop"><img src="../../_static//img/right.svg" alt="backtop"/> </div>
<section class="footerSec">
    <div class="footerHeader">
      <ul class="d-flex align-md-items-center justify-content-between flex-column flex-md-row">
        <li class="copywrite d-flex align-items-center">
          <h5 id="copy-right-info">© 2020 Apache Software Foundation | All right reserved</h5>
        </li>
      </ul>

    </div>

    <ul>
      <li class="footernote">Copyright © 2020 The Apache Software Foundation. Apache TVM, Apache, the Apache feather, and the Apache TVM project logo are either trademarks or registered trademarks of the Apache Software Foundation.</li>
    </ul>

</section>
</footer>
        </div>
      </div>

    </section>

  </div>
  

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  </body>
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-75982049-2', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>